﻿
@{
    ViewBag.Title = "评论列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section styles{
    <link href="~/bootstrap/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
}

@section scripts{
    <script type="text/javascript" src="~/bootstrap/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="~/bootstrap/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>

    <script src="~/js/admin.js?v=2.0"></script>
    <script type="text/javascript">
        var $table = $("#bsTable");
        $(function () {
            $table.bootstrapTable({
                url: "@Url.Action("GetList")",
                pagination: true,
                pageSize: 10,
                singleSelect: true,//复选框只能选中一个
                clickToSelect: true,//单击行勾选复选框
                queryParams: queryParams
            });
        });

        function queryParams(params) {
            console.log(params);
            return {
                PageIndex: params.offset / params.limit + 1,
                PageSize: params.limit,
                Key: $("#Key").val(),
                commentid:'@ViewBag.CommentId'
            };
        }

        function Search() {
            $table.bootstrapTable("refreshOptions", {
                pageNumber: 1,
                queryParams: queryParams
            });
        }
      

    </script>

}

    <ul class="page-breadcrumb breadcrumb">
        <li>
            <a href="@Url.Action("Index","Comment")">
                评论管理
            </a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            评论列表
        </li>
    </ul>

<div class="row">
    <div class="col-md-12">

        <div class="portlet-body">
            <div class="row">
                <div class="form-group">
                    <div class="col-sm-8">
                    </div>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <div>
                                <input id="Key" class="form-control" type="text" placeholder="评论内容" />
                            </div>
                            <span class="input-group-btn">
                                <button class="btn btn-success" onclick="Search();" type="button"><i class="fa fa-search"></i> 查询</button>
                            </span>
                        </div>
                    </div>
                </div>
            </div><br />
            <table id="bsTable">
                <thead>
                    <tr>
                        @*<th data-checkbox="true"></th>*@

                        <th data-field="username">点评人</th>
                        <th data-field="content">内容</th>
                        <th data-field="likecount">点赞数</th>
                        <th data-field="createtime">时间</th>
                        <th data-field="is_audit" data-formatter="auditFormatter">审核状态</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
</div>


